home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
sos3-2.lha
/
bin
/
sos-csz
< prev
next >
Wrap
Text File
|
1992-02-13
|
1KB
|
41 lines
#!/bin/sh
# --------------------------------------------------------------------------
# Copyright 1992 by Forschungszentrum Informatik (FZI)
#
# You can use and distribute this software under the terms of the licence
# you should have received along with this program.
# If not or if you want additional information, write to
# Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
# D-7500 Karlsruhe 1, Germany.
# --------------------------------------------------------------------------
# 'sos_csz - 27:02:91 - Dietmar Theobald'
#
# sos-csz [-o] [-l <level>] [<container [<offset]]
#
# Produce size statistics from dump.
#
BINDIR=${SOSPATH-__SOS_INSTALLED_PATH__}/bin/
for arg
do
case "$arg" in
-l|-o) ;;
-*) echo >&2 '*** usage: sos-csz [-o] [-l <level>] [<container [<offset]]'
exit 1 ;;
esac
done
test="${SOSCONTAINER?}"
${BINDIR}dmp $*\
| sed -e 's|^<\([0-9]*\)/.*:\[\([^(]*\)(\([0-9]*\)).*|\1 \2 \3|'\
| awk 'BEGIN {FS=" "}
{a[$1 " of " $2] += $3
a[$1 " of all"] += $3
b[$1 " of " $2] += 1
b[$1 " of all"] += 1
}
END {for (i in a) print "size/count in " i " = " a[i] " / " b[i]
}'\
| sort